package com.egene.zh.activity.contact;

import android.os.Bundle;

import com.easemob.easeui.EaseConstant;
import com.egene.zh.base.BaseViewPagerFragment;
import com.egene.zh.base.ViewPageFragmentAdapter;
import com.egene.zh.dao.UserDao;

import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EFragment;

@EFragment
public class ContactViewPagerFragment  extends BaseViewPagerFragment {

    @Bean
    UserDao userDao;

    @Override
    protected void onSetupTabAdapter(ViewPageFragmentAdapter adapter) {
        for(ContactTab tab : ContactTab.values()){
            adapter.addTab(tab.getTitle(),tab.name(),tab.getClz(),getBundle());
        }
    }

    private Bundle getBundle() {
        Bundle bundle = new Bundle();
        bundle.putString(EaseConstant.EXTRA_SELF_USER_ID,userDao.getUser().getUserID());
        return bundle;
    }
}